<title>Feedback</title>
<script>
    // Block non-numeric chars.
    $(document).on('keypress', 'input[name=mobile]', function(event) {
        return (((event.which > 47) && (event.which < 58)) || (event.which == 13));
    });

    $(function() {
        $("input[name='submit']").click(function() {
            var mobileLength = $("input[name='mobile']").val().length;
            if (mobileLength === 0) {
                alert("Please enter mobile number");
                return  false;
            }
            if (mobileLength !== 10) {
                alert("Mobile number must be 10 digits.");
                return  false;
            }
        });
    });
</script>
<div id="view-content">
    <h1>Feedback</h1>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span6 well">            
            <?php if ($this->isSent) { ?>
                <div class="alert alert-info">            
                    <h4>Message Sent to owner:</h4>
                    Thank you for your feedback. We'll shortly back to you.
                </div>        
            <?php } else {
                ?>
                <div class="alert alert-info">                                
                    Your feedback is important to us.
                </div>        
                <?= $this->form ?>
            <?php }
            ?>            
        </div>
    </div>
</div>